﻿package view.component
{
    import flash.display.*;
    import morn.core.components.*;

    public class TransPoint extends Object
    {
        private var _container:DisplayObjectContainer;
        private var _func:Function;
        private var img:Image;
        private var _Nmtxt:Label;
        public var gameObj:Object;
        private var sp:Sprite;

        public function TransPoint(param1:DisplayObjectContainer, param2:Object)
        {
            this._container = param1;
            this.gameObj = param2;
            this.initView();
            return;
        }// end function

        private function initView() : void
        {
            this.sp = new Sprite();
            this.img = new Image("png.common.trains_point");
            this.sp.addChild(this.img);
            this.img.x = 28;
            this.img.y = 0;
            this._Nmtxt = new Label("矿区二层");
            this.sp.addChild(this._Nmtxt);
            this._Nmtxt.text = this.gameObj.name;
            this._container.addChild(this.sp);
            this.sp.mouseChildren = false;
            this.sp.mouseEnabled = false;
            return;
        }// end function

        public function setpivotXY(param1:int, param2:int) : void
        {
            this.sp.x = param1 - 50;
            this.sp.y = param2 - 23;
            return;
        }// end function

        public function dispose() : void
        {
            if (this.img && this.img.parent)
            {
                this.img.parent.removeChild(this.img);
            }
            if (this.img)
            {
                this.img = null;
            }
            if (this._Nmtxt && this._Nmtxt.parent)
            {
                this._Nmtxt.parent.removeChild(this._Nmtxt);
            }
            if (this._Nmtxt)
            {
                this._Nmtxt = null;
            }
            if (this.sp && this.sp.parent)
            {
                this.sp.parent.removeChild(this.sp);
            }
            this.gameObj = null;
            this._container = null;
            return;
        }// end function

    }
}
